import request from '@/utils/request'

// 获取所有标签
export const getAllType = function () {
    return request({
        url: '/goodType/all',
        method: 'get',
      })
}

// 添加一个标签
export const addGoodType = function (data) {
  return request({
    url: '/goodType/add',
    method: 'post',
    data
  })
}

// 获取当前等级的标签
export const getCurrentLevel =  function (data) {
  return request({
    url: '/goodType/currentLevel/'+data,
    method: 'get',
  })
}

// 进入当前标签的子标签
export const getChidrenType =function (data) {
  return request({
    url: '/goodType/children/'+data,
    method: 'get',
  })
}

//更新标签
export const UpdateType= function (data) {
  return request({
    url: '/goodType/update',
    method: 'Post',
    data
  })
}

//删除标签
export const delGoodType = function (data) {
  return request({
    url: '/goodType/delete/'+data,
    method: 'get',
  })
}